
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Go 语言常量 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../part8/" />
    
    
    <link rel="prev" href="../part6/" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../part1/">
            
                <a href="../part1/">
            
                    
                    Go 语言简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../part2/">
            
                <a href="../part2/">
            
                    
                    Go 语言环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../part3/">
            
                <a href="../part3/">
            
                    
                    Go 语言结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../part4/">
            
                <a href="../part4/">
            
                    
                    Go 语言基础语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../part5/">
            
                <a href="../part5/">
            
                    
                    Go 语言数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../part6/">
            
                <a href="../part6/">
            
                    
                    Go 语言变量
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.8" data-path="./">
            
                <a href="./">
            
                    
                    Go 语言常量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../part8/">
            
                <a href="../part8/">
            
                    
                    Go 语言运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../part9/">
            
                <a href="../part9/">
            
                    
                    Go 语言条件语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../part10/">
            
                <a href="../part10/">
            
                    
                    Go 语言循环语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../part11/">
            
                <a href="../part11/">
            
                    
                    Go 语言函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../part12/">
            
                <a href="../part12/">
            
                    
                    Go 语言数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../part13/">
            
                <a href="../part13/">
            
                    
                    Go 语言指针
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../part14/">
            
                <a href="../part14/">
            
                    
                    Go 语言结构体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../part15/">
            
                <a href="../part15/">
            
                    
                    Go 语言切片(Slice)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../part16/">
            
                <a href="../part16/">
            
                    
                    Go 语言范围(Range)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../part17/">
            
                <a href="../part17/">
            
                    
                    Go 语言Map(集合)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="../part18/">
            
                <a href="../part18/">
            
                    
                    Go 语言递归函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="../part19/">
            
                <a href="../part19/">
            
                    
                    Go 语言类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="../part20/">
            
                <a href="../part20/">
            
                    
                    Go 语言接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22" data-path="../part21/">
            
                <a href="../part21/">
            
                    
                    Go 错误处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.23" data-path="../part22/">
            
                <a href="../part22/">
            
                    
                    Go 并发
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Go 语言常量</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="go-&#x8BED;&#x8A00;&#x5E38;&#x91CF;">Go &#x8BED;&#x8A00;&#x5E38;&#x91CF;</h1>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x5E38;&#x91CF;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x503C;&#x7684;&#x6807;&#x8BC6;&#x7B26;&#xFF0C;&#x5728;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x65F6;&#xFF0C;&#x4E0D;&#x4F1A;&#x88AB;&#x4FEE;&#x6539;&#x7684;&#x91CF;&#x3002;</p>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#x5E38;&#x91CF;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x53EA;&#x53EF;&#x4EE5;&#x662F;<code>&#x5E03;&#x5C14;&#x578B;</code>&#x3001;<code>&#x6570;&#x5B57;&#x578B;&#xFF08;&#x6574;&#x6570;&#x578B;&#x3001;&#x6D6E;&#x70B9;&#x578B;&#x548C;&#x590D;&#x6570;&#xFF09;</code>&#x548C;<code>&#x5B57;&#x7B26;&#x4E32;</code>&#x578B;&#x3002;</p>
<p>&#x5E38;&#x91CF;&#x7684;&#x5B9A;&#x4E49;&#x683C;&#x5F0F;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">const</span> identifier [<span class="hljs-keyword">type</span>] = value
</code></pre>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x7701;&#x7565;&#x7C7B;&#x578B;&#x8BF4;&#x660E;&#x7B26; <code>[type]</code>&#xFF0C;&#x56E0;&#x4E3A;&#x7F16;&#x8BD1;&#x5668;&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x53D8;&#x91CF;&#x7684;&#x503C;&#x6765;&#x63A8;&#x65AD;&#x5176;&#x7C7B;&#x578B;&#x3002;</p>
<ul>
<li>&#x663E;&#x5F0F;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#xFF1A; <code>const b string = &quot;abc&quot;</code></li>
<li>&#x9690;&#x5F0F;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#xFF1A; <code>const b = &quot;abc&quot;</code></li>
</ul>
<p>&#x591A;&#x4E2A;&#x76F8;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x58F0;&#x660E;&#x53EF;&#x4EE5;&#x7B80;&#x5199;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">const</span> c_name1, c_name2 = value1, value2
</code></pre>
<p>&#x4EE5;&#x4E0B;&#x5B9E;&#x4F8B;&#x6F14;&#x793A;&#x4E86;&#x5E38;&#x91CF;&#x7684;&#x5E94;&#x7528;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">package</span> main

<span class="hljs-keyword">import</span> <span class="hljs-string">&quot;fmt&quot;</span>

<span class="hljs-keyword">func</span> main() {
    <span class="hljs-keyword">const</span> LENGTH <span class="hljs-keyword">int</span> = <span class="hljs-number">10</span>
    <span class="hljs-keyword">const</span> WIDTH <span class="hljs-keyword">int</span> = <span class="hljs-number">5</span>  
    <span class="hljs-keyword">var</span> area <span class="hljs-keyword">int</span>
    <span class="hljs-keyword">const</span> a, b, c = <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-string">&quot;str&quot;</span> <span class="hljs-comment">//&#x591A;&#x91CD;&#x8D4B;&#x503C;</span>

    area = LENGTH * WIDTH
    fmt.Printf(<span class="hljs-string">&quot;&#x9762;&#x79EF;&#x4E3A; : %d&quot;</span>, area)
    <span class="hljs-built_in">println</span>()
    <span class="hljs-built_in">println</span>(a, b, c)  
}
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x5B9E;&#x4F8B;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-go">&#x9762;&#x79EF;&#x4E3A; : <span class="hljs-number">50</span>
<span class="hljs-number">1</span> <span class="hljs-literal">false</span> str
</code></pre>
<p>&#x5E38;&#x91CF;&#x8FD8;&#x53EF;&#x4EE5;&#x7528;&#x4F5C;&#x679A;&#x4E3E;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">const</span> (
    Unknown = <span class="hljs-number">0</span>
    Female = <span class="hljs-number">1</span>
    Male = <span class="hljs-number">2</span>
)
</code></pre>
<p>&#x6570;&#x5B57; 0&#x3001;1 &#x548C; 2 &#x5206;&#x522B;&#x4EE3;&#x8868;&#x672A;&#x77E5;&#x6027;&#x522B;&#x3001;&#x5973;&#x6027;&#x548C;&#x7537;&#x6027;&#x3002;</p>
<p>&#x5E38;&#x91CF;&#x53EF;&#x4EE5;&#x7528;<code>len()</code>, <code>cap()</code>, <code>unsafe.Sizeof()</code>&#x51FD;&#x6570;&#x8BA1;&#x7B97;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x503C;&#x3002;&#x5E38;&#x91CF;&#x8868;&#x8FBE;&#x5F0F;&#x4E2D;&#xFF0C;&#x51FD;&#x6570;&#x5FC5;&#x987B;&#x662F;&#x5185;&#x7F6E;&#x51FD;&#x6570;&#xFF0C;&#x5426;&#x5219;&#x7F16;&#x8BD1;&#x4E0D;&#x8FC7;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">import</span> <span class="hljs-string">&quot;unsafe&quot;</span>

<span class="hljs-keyword">const</span> (
    a = <span class="hljs-string">&quot;abc&quot;</span>
    b = <span class="hljs-built_in">len</span>(a)
    c = unsafe.Sizeof(a)
)

<span class="hljs-keyword">func</span> main(){
    <span class="hljs-built_in">println</span>(a, b, c)
}
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x5B9E;&#x4F8B;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-sh">abc 3 16
</code></pre>
<hr>
<h2 id="iota">iota</h2>
<p>&#x5B9E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">package</span> main

<span class="hljs-keyword">import</span> <span class="hljs-string">&quot;fmt&quot;</span>

<span class="hljs-keyword">func</span> main() {
    <span class="hljs-keyword">const</span> (
        a = <span class="hljs-literal">iota</span>   <span class="hljs-comment">//0</span>
        b          <span class="hljs-comment">//1</span>
        c          <span class="hljs-comment">//2</span>
        d = <span class="hljs-string">&quot;ha&quot;</span>   <span class="hljs-comment">//&#x72EC;&#x7ACB;&#x503C;&#xFF0C;iota += 1</span>
        e          <span class="hljs-comment">//&quot;ha&quot;   iota += 1</span>
        f = <span class="hljs-number">100</span>    <span class="hljs-comment">//iota +=1</span>
        g          <span class="hljs-comment">//100  iota +=1</span>
        h = <span class="hljs-literal">iota</span>   <span class="hljs-comment">//7,&#x6062;&#x590D;&#x8BA1;&#x6570;</span>
        i          <span class="hljs-comment">//8</span>
    )
    fmt.Println(a, b, c, d, e, f, g, h, i)
}
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x5B9E;&#x4F8B;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-sh">0 1 2 ha ha 100 100 7 8
</code></pre>
<p>&#x518D;&#x770B;&#x4E2A;&#x6709;&#x8DA3;&#x7684;&#x7684; iota &#x5B9E;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-keyword">package</span> main

<span class="hljs-keyword">import</span> <span class="hljs-string">&quot;fmt&quot;</span>
<span class="hljs-keyword">const</span> (
    i = <span class="hljs-number">1</span> &lt;&lt; <span class="hljs-literal">iota</span>
    j = <span class="hljs-number">3</span> &lt;&lt; <span class="hljs-literal">iota</span>
    k
    l
)

<span class="hljs-keyword">func</span> main() {
    fmt.Println(<span class="hljs-string">&quot;i =&quot;</span>, i)
    fmt.Println(<span class="hljs-string">&quot;j =&quot;</span>, j)
    fmt.Println(<span class="hljs-string">&quot;k =&quot;</span>, k)
    fmt.Println(<span class="hljs-string">&quot;l =&quot;</span>, l)
}
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x5B9E;&#x4F8B;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-sh">i = 1
j = 6
k = 12
l = 24
</code></pre>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;<code>iota</code> &#x8868;&#x793A;&#x4ECE; <code>0</code> &#x5F00;&#x59CB;&#x81EA;&#x52A8;&#x52A0; <code>1</code>&#xFF0C;&#x6240;&#x4EE5; <code>i=1&lt;&lt;0</code>, <code>j=3&lt;&lt;1</code>&#xFF08;<code>&lt;&lt;</code> &#x8868;&#x793A;&#x5DE6;&#x79FB;&#x7684;&#x610F;&#x601D;&#xFF09;&#xFF0C;&#x5373;&#xFF1A;<code>i=1</code>, <code>j=6</code>&#xFF0C;&#x8FD9;&#x6CA1;&#x95EE;&#x9898;&#xFF0C;&#x5173;&#x952E;&#x5728; k &#x548C; l&#xFF0C;&#x4ECE;&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x770B; <code>k=3&lt;&lt;2</code>&#xFF0C;<code>l=3&lt;&lt;3</code>&#x3002;</p>
<p>&#x7B80;&#x5355;&#x8868;&#x8FF0;:</p>
<ul>
<li><strong><code>i=1</code></strong>&#xFF1A;&#x5DE6;&#x79FB; 0 &#x4F4D;,&#x4E0D;&#x53D8;&#x4ECD;&#x4E3A; 1;</li>
<li><strong><code>j=3</code></strong>&#xFF1A;&#x5DE6;&#x79FB; 1 &#x4F4D;,&#x53D8;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236; 110, &#x5373; 6;</li>
<li><strong><code>k=3</code></strong>&#xFF1A;&#x5DE6;&#x79FB; 2 &#x4F4D;,&#x53D8;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236; 1100, &#x5373; 12;</li>
<li><strong><code>l=3</code></strong>&#xFF1A;&#x5DE6;&#x79FB; 3 &#x4F4D;,&#x53D8;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236; 11000,&#x5373; 24&#x3002;</li>
</ul>
<p>&#x6CE8;&#xFF1A;<strong><code>&lt;&lt;n==*(2^n)</code></strong>&#x3002;</p>
<hr>
<h2 id="ps">PS</h2>
<ol>
<li><p>&#x5B57;&#x7B26;&#x4E32;&#x957F;&#x5EA6;</p>
<pre><code class="lang-go"> <span class="hljs-keyword">package</span> main

 <span class="hljs-keyword">import</span> (
     <span class="hljs-string">&quot;fmt&quot;</span>
     <span class="hljs-string">&quot;unsafe&quot;</span>
 )

 <span class="hljs-keyword">func</span> main() {
     a := <span class="hljs-string">&quot;hello&quot;</span>
     fmt.Println(unsafe.Sizeof(a))
 }
</code></pre>
<p> &#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x4E3A;&#xFF1A;16</p>
<p> &#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x5728; <code>go</code> &#x91CC;&#x662F;&#x4E2A;&#x7ED3;&#x6784;&#xFF0C;&#x5305;&#x542B;&#x6307;&#x5411;&#x5E95;&#x5C42;&#x6570;&#x7EC4;&#x7684;&#x6307;&#x9488;&#x548C;&#x957F;&#x5EA6;&#xFF0C;&#x8FD9;&#x4E24;&#x90E8;&#x5206;&#x6BCF;&#x90E8;&#x5206;&#x90FD;&#x662F; <code>8</code> &#x4E2A;&#x5B57;&#x8282;&#xFF0C;&#x6240;&#x4EE5;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x5927;&#x5C0F;&#x4E3A; <code>16</code> &#x4E2A;&#x5B57;&#x8282;&#x3002;</p>
</li>
</ol>
<ol>
<li><p><strong>&#x5728;&#x5B9A;&#x4E49;&#x5E38;&#x91CF;&#x7EC4;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x63D0;&#x4F9B;&#x521D;&#x59CB;&#x503C;&#xFF0C;&#x5219;&#x8868;&#x793A;&#x5C06;&#x4F7F;&#x7528;&#x4E0A;&#x884C;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x3002;</strong></p>
<pre><code class="lang-go"> <span class="hljs-keyword">package</span> main

 <span class="hljs-keyword">import</span> <span class="hljs-string">&quot;fmt&quot;</span>

 <span class="hljs-keyword">const</span> (
     a = <span class="hljs-number">1</span>
     b
     c
     d
 )

 <span class="hljs-keyword">func</span> main() {
     fmt.Println(a)
     <span class="hljs-comment">// b&#x3001;c&#x3001;d&#x6CA1;&#x6709;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x4F7F;&#x7528;&#x4E0A;&#x4E00;&#x884C;(&#x5373;a)&#x7684;&#x503C;</span>
     fmt.Println(b)   <span class="hljs-comment">// &#x8F93;&#x51FA;1</span>
     fmt.Println(c)   <span class="hljs-comment">// &#x8F93;&#x51FA;1</span>
     fmt.Println(d)   <span class="hljs-comment">// &#x8F93;&#x51FA;1</span>
 }
</code></pre>
</li>
<li><p>&#x5173;&#x4E8E;<code>iota</code>
 <code>iota</code> &#x53EA;&#x662F;&#x5728;&#x540C;&#x4E00;&#x4E2A; <code>const</code> &#x5E38;&#x91CF;&#x7EC4;&#x5185;&#x9012;&#x589E;&#xFF0C;&#x6BCF;&#x5F53;&#x6709;&#x65B0;&#x7684; <code>const</code> &#x5173;&#x952E;&#x5B57;&#x65F6;&#xFF0C;<code>iota</code> &#x8BA1;&#x6570;&#x4F1A;&#x91CD;&#x65B0;&#x5F00;&#x59CB;&#x3002;</p>
<pre><code class="lang-go"> <span class="hljs-keyword">package</span> main

 <span class="hljs-keyword">const</span> (
     i = <span class="hljs-literal">iota</span>
     j = <span class="hljs-literal">iota</span>
     x = <span class="hljs-literal">iota</span>
 )
 <span class="hljs-keyword">const</span> xx = <span class="hljs-literal">iota</span>
 <span class="hljs-keyword">const</span> yy = <span class="hljs-literal">iota</span>
 <span class="hljs-keyword">func</span> main(){
     <span class="hljs-built_in">println</span>(i, j, x, xx, yy)
 }

 <span class="hljs-comment">// &#x8F93;&#x51FA;&#x662F; 0 1 2 0 0</span>
</code></pre>
</li>
<li><p>&#x5DE6;&#x79FB;&#x53F3;&#x79FB;</p>
<ul>
<li><p>&#x5DE6;&#x79FB;&#x8FD0;&#x7B97;&#x7B26; <code>&lt;&lt;</code> &#x662F;&#x53CC;&#x76EE;&#x8FD0;&#x7B97;&#x7B26;&#x3002;&#x5DE6;&#x79FB; <code>n</code> &#x4F4D;&#x5C31;&#x662F;&#x4E58;&#x4EE5; <code>2&#x7684;n&#x6B21;&#x65B9;</code>&#x3002; &#x5176;&#x529F;&#x80FD;&#x628A; <code>&lt;&lt;</code> &#x5DE6;&#x8FB9;&#x7684;&#x8FD0;&#x7B97;&#x6570;&#x7684;&#x5404;&#x4E8C;&#x8FDB;&#x4F4D;&#x5168;&#x90E8;&#x5DE6;&#x79FB;&#x82E5;&#x5E72;&#x4F4D;&#xFF0C;&#x7531; <code>&lt;&lt;</code> &#x53F3;&#x8FB9;&#x7684;&#x6570;&#x6307;&#x5B9A;&#x79FB;&#x52A8;&#x7684;&#x4F4D;&#x6570;&#xFF0C;&#x9AD8;&#x4F4D;&#x4E22;&#x5F03;&#xFF0C;&#x4F4E;&#x4F4D;&#x8865; <code>0</code>&#x3002;</p>
</li>
<li><p>&#x53F3;&#x79FB;&#x8FD0;&#x7B97;&#x7B26; <code>&gt;&gt;</code> &#x662F;&#x53CC;&#x76EE;&#x8FD0;&#x7B97;&#x7B26;&#x3002;&#x53F3;&#x79FB; <code>n</code> &#x4F4D;&#x5C31;&#x662F;&#x9664;&#x4EE5; <code>2&#x7684;n&#x6B21;&#x65B9;</code>&#x3002; &#x5176;&#x529F;&#x80FD;&#x662F;&#x628A; <code>&gt;&gt;</code> &#x5DE6;&#x8FB9;&#x7684;&#x8FD0;&#x7B97;&#x6570;&#x7684;&#x5404;&#x4E8C;&#x8FDB;&#x4F4D;&#x5168;&#x90E8;&#x53F3;&#x79FB;&#x82E5;&#x5E72;&#x4F4D;&#xFF0C; <code>&gt;&gt;</code> &#x53F3;&#x8FB9;&#x7684;&#x6570;&#x6307;&#x5B9A;&#x79FB;&#x52A8;&#x7684;&#x4F4D;&#x6570;&#x3002;</p>
</li>
</ul>
</li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../part6/" class="navigation navigation-prev " aria-label="Previous page: Go 语言变量">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../part8/" class="navigation navigation-next " aria-label="Next page: Go 语言运算符">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Go 语言常量","level":"1.8","depth":1,"next":{"title":"Go 语言运算符","level":"1.9","depth":1,"path":"part8/README.md","ref":"part8/README.md","articles":[]},"previous":{"title":"Go 语言变量","level":"1.7","depth":1,"path":"part6/README.md","ref":"part6/README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"part7/README.md","mtime":"2021-01-19T11:30:22.588Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-21T06:29:04.898Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

